<?php namespace app\wechat\controller;

use houdunwang\request\Request;
use houdunwang\route\Controller;
use system\model\Config;
/**
 * 微信系统回复
 * Class System
 * @package app\wechat\controller
 */
class System extends Common {
    //动作
    public function index(){
        //此处书写代码...
		$model = Config::find(1) ? : new Config();
		if(IS_POST)
		{
			$post = Request::post();
			$model->wechat_system_response = json_encode($post,JSON_UNESCAPED_UNICODE);
			$model->save();
			return $this->setRedirect('refresh')->success('操作成功');
		}
		$field = json_decode($model['wechat_system_response'],true);
		return view('',compact('field'));
    }
}
